import { computed, Ref, watch } from 'vue'
import { useRoute } from 'vue-router'

export function useVolunteer({ modelType }: { modelType: Ref<string> }) {
  const route = useRoute()
  const isVolunteer = computed(() => route.query.from === 'zyz')

  watch(
    isVolunteer,
    (isVolunteer) => {
      if (isVolunteer) {
        modelType.value = '6'
      }
    },
    { immediate: true }
  )

  return {
    isVolunteer,
  }
}
